//
// Created by nicemoe on 2021/8/7.
//

#include <iostream>

using namespace std;

int main()
{
    double m[5] = {3.1, 4.5, 6.3, 7.6, 1.4};

    //x是值复制 无法修改m数组
    for (double x : m)
    {
        x++;
    }
    for (double x : m)
    {
        cout << x << "\t";
    }
    cout << endl;

    //&x是引用可以真正修改m数组
    for (double &x : m)
    {
        x++;
    }
    cout << endl;
    for (double x : m)
    {
        cout << x << "\t";
    }
    cout << endl;
    return 0;
}